/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package pl.put.dcs.workManagerServer.projectManager.queueManager.cacheManeger.CacheManagerImpl.jbossCacheManager;


import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import org.apache.log4j.Logger;
import org.jboss.cache.Fqn;
import org.jboss.cache.marshall.AbstractMarshaller;
import pl.put.dcs.core.utils.serializer.SerializeManager;
/**
 *
 * @author LukaszR
 */
public class JbossCacheMarshaller extends AbstractMarshaller
{
    public static Logger log = Logger.getLogger( JbossCacheMarshaller.class.getName() );
    private SerializeManager sm = new SerializeManager();

    public JbossCacheMarshaller()
    {
       
    }

    public void objectToObjectStream( Object obj, ObjectOutputStream out ) throws Exception
    {
        log.info( "test2222: " + obj.getClass().getName() );
        sm.init();

        sm.serializeToFile( obj, out );
    }

    public Object objectFromObjectStream( ObjectInputStream in ) throws Exception
    {
        return sm.unSerializeFromFile( in );
    }

    public void objectToObjectStream( Object obj, ObjectOutputStream out, Fqn region ) throws Exception
    {
        throw new UnsupportedOperationException( "Not supported yet." );
    }

}
